﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2._1_NiXuShu
{
    class Program
    {
        static void Main(string[] args)
        {


            //Console.Write("请输入一位四位数：");
            //int number = Convert.ToInt32(Console.ReadLine());
            //int qw = number / 1000;
            //int bw = number / 100%10;
            //int sw = (number/10)%10;
            //int gw = number % 10;
            //int ni = gw * 1000 + sw * 100 + bw*10+qw;

            //Console.WriteLine("该数的逆序数为:{0}",ni);
            //Console.ReadLine();


            Console.Write("请输入一个多位数,输入-1结束：");
            int num = Convert.ToInt32(Console.ReadLine());

            int a = 0;
            while (a != -1)
            {

                int num1 = num;
                int tmp = 0, sum = 0;
                while (num != 0)
                {
                    tmp = tmp * 10 + num % 10;
                    sum = sum + num % 10;
                    num = num / 10;
                }
                Console.WriteLine("{0}的逆序是{1},和是{2}", num1, tmp, sum);
                Console.Write("请输入一个多位数,输入-1结束：");
                a = Convert.ToInt16(Console.ReadLine());
                num = a;

            }
        }
    }
}
